﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:UTable.Objects.Controls">
    <Style TargetType="{x:Type local:UElementMenuDirectory}">
        <Setter Property="Height" Value="45"/>
        <Setter Property="Width" Value="45"/>
        <Setter Property="Opacity" Value="0"/>
        <Setter Property="Panel.ZIndex" Value="0"/>
        <Setter Property="IsActive" Value="False"/>
        <Setter Property="ClipToBounds" Value="False"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <local:UElementMenuPanel x:Name="ItemsP"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid x:Name="ContentHeaderGrid" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="1">
                        <Rectangle x:Name="ContentHeaderShadow" StrokeThickness="1" RadiusX="4" RadiusY="4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Rectangle.Fill>
                                <RadialGradientBrush GradientOrigin="0.5,0.072">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="-3" ScaleY="-2"/>
                                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5"/>
                                            <RotateTransform Angle="359.337" CenterX="0.5" CenterY="0.5"/>
                                            <TranslateTransform X="-0.001" Y="-0.126"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="Transparent" Offset="0.205"/>
                                    <GradientStop Color="#26000000" Offset="0.652"/>
                                </RadialGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle x:Name="Mask" StrokeThickness="1" RadiusX="4" RadiusY="4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Opacity="0">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="Gray"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <ContentPresenter Content="{Binding}">
                            <ContentPresenter.Resources>
                                <Style TargetType="{x:Type TextBlock}">
                                    <Setter Property="Foreground" Value="White"/>
                                </Style>
                            </ContentPresenter.Resources>
                        </ContentPresenter>
                    </Grid>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:UElementMenuItem}},Path=IsPressed}" Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Mask" Storyboard.TargetProperty="Opacity" To="0.9"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Mask" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:UElementMenuDirectory}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="IsEnabledTrue">
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                        <Storyboard x:Key="IsSubmenuOpenTrue">
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="ContentHeaderGrid" Storyboard.TargetProperty="(UIElement.Opacity)" To="0.5"/>
                        </Storyboard>
                        <Storyboard x:Key="IsPressedFalse">
                            <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Color)" To="#4D000000"/>
                            <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Color)" To="#27000000"/>
                            <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Color)" To="#00000000"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[1].(GradientStop.Offset)" To="0.461864"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Offset)" To="0.461864"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Offset)" To="0.642675"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Offset)" To="0.838983"/>
                            <ThicknessAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Center" Storyboard.TargetProperty="(FrameworkElement.Margin)" To="13.5"/>
                        </Storyboard>
                        <Storyboard x:Key="IsEnabledFalse">
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.3"/>
                        </Storyboard>
                        <Storyboard x:Key="IsActiveTrue">
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetProperty="Opacity" To="1"/>
                            <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.5000000" FillBehavior="Stop" SpeedRatio="2" Storyboard.TargetProperty="IsHitTestVisible">
                                <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                                <DiscreteBooleanKeyFrame KeyTime="00:00:00.2500000" Value="True"/>
                            </BooleanAnimationUsingKeyFrames>
                        </Storyboard>
                        <Storyboard x:Key="IsActiveFalse">
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetProperty="Opacity" To="0"/>
                        </Storyboard>
                        <Storyboard x:Key="IsPressedTrue">
                            <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Color)" To="#4DFFFFFF"/>
                            <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Color)" To="#27FFFFFF"/>
                            <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Color)" To="Transparent"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[1].(GradientStop.Offset)" To="0.3347"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Offset)" To="0.3347"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Offset)" To="0.7387"/>
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Offset)" To="0.9407"/>
                            <ThicknessAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Center" Storyboard.TargetProperty="(FrameworkElement.Margin)" To="10"/>
                        </Storyboard>
                        <Storyboard x:Key="IsSubmenuOpenFalse">
                            <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="ContentHeaderGrid" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                        </Storyboard>
                    </ControlTemplate.Resources>                        
                    <Grid x:Name="Content" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Opacity="1">
                        <Grid x:Name="VisualContent">
                            <Ellipse Fill="Transparent"/>
                            <Ellipse x:Name="Shadow" Stretch="Fill" Margin="9" IsHitTestVisible="False">
                                <Ellipse.Fill>
                                    <RadialGradientBrush RadiusX="0.5" RadiusY="0.5">
                                        <GradientStop Color="#00000000" Offset="0"/>
                                        <GradientStop Color="#00000000" Offset="0.461864"/>
                                        <GradientStop Color="#4D000000" Offset="0.461864"/>
                                        <GradientStop Color="#27000000" Offset="0.642675"/>
                                        <GradientStop Color="#00000000" Offset="0.838983"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="Bg" Fill="{TemplateBinding Background}" Margin="9" IsHitTestVisible="False"/>
                            <Ellipse x:Name="Fill" Stretch="Fill" Margin="6" IsHitTestVisible="False">
                                <Ellipse.Fill>
                                    <RadialGradientBrush RadiusX="0.5" RadiusY="0.5">
                                        <GradientStop Color="#32FFFFFF" Offset="0.669492"/>
                                        <GradientStop Color="Transparent" Offset="0.788136"/>
                                        <GradientStop Color="#3AFFFFFF" Offset="0.833065"/>
                                        <GradientStop Color="#73FFFFFF" Offset="0.851695"/>
                                        <GradientStop Color="Transparent" Offset="0.932203"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="OrbitV" Stretch="Fill" Margin="13.5" IsHitTestVisible="False">
                                <Ellipse.Fill>
                                    <RadialGradientBrush RadiusX="0.625005" RadiusY="0.5">
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <RotateTransform Angle="90" CenterX="0.5" CenterY="0.5"/>
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Color="#00000000" Offset="0.131356"/>
                                        <GradientStop Color="#147F7F7F" Offset="0.584746"/>
                                        <GradientStop Color="#27FFFFFF" Offset="0.694915"/>
                                        <GradientStop Color="#207F7F7F" Offset="0.864407"/>
                                        <GradientStop Color="#1A000000" Offset="1"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="OrbitH" Stretch="Fill" Margin="13.5" IsHitTestVisible="False">
                                <Ellipse.Fill>
                                    <RadialGradientBrush RadiusX="0.5" RadiusY="0.3">
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <RotateTransform Angle="180" CenterX="0.5" CenterY="0.5"/>
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Color="#D9FFFFFF" Offset="0"/>
                                        <GradientStop Color="#6DFFFFFF" Offset="0.433155"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="Ring" Stretch="Fill" Margin="13.5" IsHitTestVisible="False">
                                <Ellipse.Fill>
                                    <RadialGradientBrush RadiusX="0.5" RadiusY="0.5">
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <RotateTransform Angle="90" CenterX="0.5" CenterY="0.5"/>
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Color="Transparent" Offset="0"/>
                                        <GradientStop Color="Transparent" Offset="0.652542"/>
                                        <GradientStop Color="#60FFFFFF" Offset="0.804555"/>
                                        <GradientStop Color="#BFFFFFFF" Offset="0.889831"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="Center" Stretch="Fill" Margin="13.5" IsHitTestVisible="False">
                                <Ellipse.Fill>
                                    <RadialGradientBrush RadiusX="1" RadiusY="1">
                                        <GradientStop Color="White" Offset="0"/>
                                        <GradientStop Color="#80FFFFFF" Offset="0.171324"/>
                                        <GradientStop Color="Transparent" Offset="0.372881"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <ContentPresenter x:Name="Icon" Margin="13.5" IsHitTestVisible="False" Content="{TemplateBinding Icon}" ContentSource="Icon">
                                <ContentPresenter.OpacityMask>
                                    <RadialGradientBrush>
                                        <GradientStop Color="White" Offset="0.9"/>
                                        <GradientStop Color="Transparent" Offset="0.98"/>
                                    </RadialGradientBrush>
                                </ContentPresenter.OpacityMask>
                            </ContentPresenter>
                        </Grid>
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/>
                        <Canvas HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Path x:Name="PART_Line" StrokeThickness="2" Stroke="White" Opacity="0.7"/>
                        </Canvas>
                        <Canvas HorizontalAlignment="Center" VerticalAlignment="Center" Margin="-30, -63, 0, 0">
                            <ContentPresenter x:Name="PART_HeaderPresenter" ContentSource="Header"/>
                        </Canvas>
                        <ItemsPresenter x:Name="PART_ItemsPresenter" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsActive" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" SpeedRatio="2">
                                            <SplineDoubleKeyFrame Value="1" KeyTime="00:00:00.5000000">
                                                <SplineDoubleKeyFrame.KeySpline>
                                                    <KeySpline ControlPoint1="0, 1" ControlPoint2="1, 1"/>
                                                </SplineDoubleKeyFrame.KeySpline>
                                            </SplineDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.5000000" FillBehavior="Stop" SpeedRatio="2" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                                            <DiscreteBooleanKeyFrame KeyTime="00:00:00.2500000" Value="True"/>
                                        </BooleanAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" SpeedRatio="2">
                                            <SplineDoubleKeyFrame Value="0" KeyTime="00:00:00.5000000">
                                                <SplineDoubleKeyFrame.KeySpline>
                                                    <KeySpline ControlPoint1="0, 1" ControlPoint2="1, 1"/>
                                                </SplineDoubleKeyFrame.KeySpline>
                                            </SplineDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.3"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Color)" To="#4DFFFFFF"/>
                                        <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Color)" To="#27FFFFFF"/>
                                        <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Color)" To="Transparent"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[1].(GradientStop.Offset)" To="0.3347"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Offset)" To="0.3347"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Offset)" To="0.7387"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Offset)" To="0.9407"/>
                                        <ThicknessAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Center" Storyboard.TargetProperty="(FrameworkElement.Margin)" To="10"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Color)" To="#4D000000"/>
                                        <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Color)" To="#27000000"/>
                                        <ColorAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Color)" To="#00000000"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[1].(GradientStop.Offset)" To="0.461864"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[2].(GradientStop.Offset)" To="0.461864"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[3].(GradientStop.Offset)" To="0.642675"/>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops).[4].(GradientStop.Offset)" To="0.838983"/>
                                        <ThicknessAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="Center" Storyboard.TargetProperty="(FrameworkElement.Margin)" To="13.5"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsSubmenuOpen" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="PART_HeaderPresenter" Storyboard.TargetProperty="(UIElement.Opacity)" To="0.5"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.5000000" SpeedRatio="2" Storyboard.TargetName="PART_HeaderPresenter" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                            <Setter Property="Panel.ZIndex" Value="1"/>
                        </Trigger>
                        <Trigger Property="IsSubmenuOpen" Value="False">
                            <Setter Property="Panel.ZIndex" Value="0"/>
                        </Trigger>
                        <Trigger Property="Header" Value="">
                            <Setter Property="UIElement.Visibility" TargetName="PART_HeaderPresenter" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Header" Value="{x:Null}">
                            <Setter Property="UIElement.Visibility" TargetName="PART_HeaderPresenter" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>